import axios from '@/utils/request'

export function getEmployeetList(params) {
  return axios({
    url: '/sys/user',
    params
  })
}

export function delEmployee(id) {
  return axios({
    url: `/sys/user/${id}`,
    method: 'delete'
  })
}

export function editEmployee(data) {
  return axios({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}

export function detailEmployee(id) {
  return axios({
    url: `/sys/user/${id}`
  })
}

export function addEmployee(data) {
  return axios({
    url: '/sys/user',
    method: 'post',
    data
  })
}

export function getEnableRoleList() {
  return axios({
    url: '/sys/role/list/enabled'
  })
}

export function getEmployRole(data) {
  return axios({
    url: '/sys/user/assignRoles',
    method: 'put',
    data
  })
}
